#ifndef __IRegClient__
#define __IRegClient__

#include <iostream>
#include "RegisterNotification.h"

using namespace std;

enum _client_type
{
    FourGameProcesses = 1,
    SixGameProcesses
};


typedef struct _basic_info
{
    string user;
    string pass;
    string hwid;
    string pkey;
    string email;
}BasicInfomation, *PBasicInformation;

typedef struct _key_info
{
    time_t      register_time;
    time_t      generate_time;
    time_t      duration;
    int         client_type;
}KeyInfo,*PKeyInfo;

class IRegClient
{
public:
    virtual int  Register(PBasicInformation pInfo) = 0;
    virtual bool Initialize(const string server_ip, unsigned short port) = 0;
    virtual void Unintialize() = 0;
    virtual int  Login(PBasicInformation pInfo) = 0;
    virtual void Logoff() = 0;
    virtual int  ChangePassword(const string new_password) = 0;
    virtual int  UnBind(PBasicInformation pInfo) = 0;
    virtual const string ErrorCodeToString(int nCode) = 0;
    virtual int  GetKeyInfo(PKeyInfo pKI) = 0;

    // IRegisterNotification
    virtual bool RegisterNotification(IRegisterNotification* pClient) = 0;
    virtual bool UnRegisterNotification(IRegisterNotification* pClient) = 0;

    virtual bool Test() = 0;
};

IRegClient* GetIRegClient();

#endif